import {createRouter, createWebHistory} from "vue-router";
import Login from "@/views/Login.vue";
import Layout from "@/views/Layout.vue";
import Shoes from "@/views/shoes.vue"
import EmployeeList from "@/views/employeeList.vue"
import ordersList from "@/views/OrdersList.vue"
import LogList from "@/views/LogList.vue"
import ReportList from "@/views/ReportList.vue"

// 定义路由关系
const routes = [
  {path: '/login', component: Login},  // 一级路由
  {
    path: '/',
    redirect: '/login',  // 重定向
    component: Layout,
    // 子路由
    children: [
      {path: '/shoes', component: Shoes},
      {path: '/employeeList',component: EmployeeList},
      {path: '/ordersList',component: ordersList},
      {path: '/log',component: LogList},
      {path: '/report',component: ReportList},
    ]
  },
]

// 创建路由器
const router = createRouter({
  history: createWebHistory(), // 路由模式
  routes: routes
})

//导出暴露
export default router
